package com.py.credit.service.impl;

import com.py.credit.dao.AuthorizeRecordDao;
import com.py.credit.entity.AuthorizeRecord;
import com.py.credit.service.AuthorizeRecordService;
import com.py.framework.core.common.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author YaoS
 * @date 2019-05-13 14:04
 */
@Service
public class AuthorizeRecordServiceImpl implements AuthorizeRecordService {

    @Autowired
    AuthorizeRecordDao recordDao;

    @Override
    public void addRecord(AuthorizeRecord record) {
        recordDao.addRecord(record);
    }

    @Override
    public List<AuthorizeRecord> selectRecordListForPage(String recordName, Page page) {
        return recordDao.selectRecordListForPage(recordName, page);
    }

    @Override
    public List<AuthorizeRecord> selectAllRecordList(String modelId) {
        return recordDao.selectAllRecordList(modelId);
    }

    @Override
    public AuthorizeRecord selectRecordDetail(String id) {
        return recordDao.selectRecordDetail(id);
    }


    @Override
    public AuthorizeRecord selectRecord(String token) {
        return recordDao.selectRecord(token);
    }

    @Override
    public Integer selectModelRecordBind(String modelId,String token){
        return recordDao.selectModelRecordBind(modelId,token);
    }

    @Override
    public void updateRecord(AuthorizeRecord record) {
        recordDao.updateRecord(record);
    }

    @Override
    public void deleteRecordById(Integer recordId) {
        recordDao.deleteRecordById(recordId);
    }

    @Override
    public void deleteRecordByIds(List<String> ids) {
        recordDao.deleteRecordByIds(ids);
    }

	@Override
	public void deleteRecordByToken(String token) {
		recordDao.deleteRecordByToken(token);		
	}

}
